<style lang="less" scoped>
.panel {
  margin-bottom: 10px;
  &-title {
    display: flex;
    padding: 10px;
    border-bottom: 0.1px solid #eaeaea;
    background: white;

    &__label {
      flex: 1;
      font-size: 16px;
      align-items: center;
    }
  }
  &-content {
    margin-bottom: 10px;
    background: white;

    &__item {
      display: flex;
      padding: 10px 10px 0 10px;
      font-size: 14px;
      &-label {
        color: #666;
      }
      &-value {
        flex: 1;
        padding-left: 15px;
        color: #333;
      }
    }
  }
}
</style>

<template>
  <div class="panel">
    <!-- title -->
    <div class="panel-title">
      <div class="panel-title__label" v-html="item.Title||'-'"></div>
      <div class="panel-title__right"></div>
    </div>
    <!-- content -->
    <div class="panel-content">
      <div class="panel-content__item">
        <div class="panel-content__item-label">申请号</div>
        <div class="panel-content__item-value">{{item.ApplicationNumber||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">申请日期</div>
        <div class="panel-content__item-value">{{item.ApplicationDate||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">公开(公告)号</div>
        <div class="panel-content__item-value">{{item.PublicationNumber||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">公开(公告)日</div>
        <div class="panel-content__item-value">{{item.PublicationDate||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
    </div>
    <!-- content -->
    <div class="panel-content">
      <div class="panel-content__item">
        <div class="panel-content__item-label">公司名称</div>
        <div class="panel-content__item-value">{{item.NameKeyNoCollection&&item.NameKeyNoCollection[0].Name||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">代理机构</div>
        <div class="panel-content__item-value">{{item.Agency&&item.Agency[0]||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">发明人</div>
        <div class="panel-content__item-value">{{item.InventorStringList&&item.InventorStringList[0]||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
    </div>
    <!-- content -->
    <div class="panel-content">
      <div class="panel-content__item">
        <div class="panel-content__item-label">专利类型</div>
        <div class="panel-content__item-value">{{item.KindCodeDesc||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">分类号</div>
        <div class="panel-content__item-value">{{item.IPCList&&item.IPCList[0]||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">分类</div>
        <div class="panel-content__item-value">{{item.IPCDesc&&item.IPCDesc[0]||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">法律状态</div>
        <div class="panel-content__item-value">{{item.LegalStatusDesc||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item">
        <div class="panel-content__item-label">详细信息</div>
        <div class="panel-content__item-value">{{item.Abstract||'-'}}</div>
        <div class="panel-content__item-right"></div>
      </div>
    </div>
    <!-- content -->
    <div class="panel-content">
      <div class="panel-content__item">
        <div class="panel-content__item-label">摘要附图</div>
        <!-- <div class="panel-content__item-value"><image :src="item.PatentImage"/></div> -->
        <div class="panel-content__item-right"></div>
      </div>
      <div class="panel-content__item-value">
        <image :src="item.PatentImage" />
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      item: {}
    };
  },
  onShow() {
    this.getInfos();
  },
  methods: {
    async getInfos() {
      const url = '/xcx/getPatentDetailById';
      const params = {
        patent_id: this.$route.query.id
      };
      const res = await this.$http.get(url, params);
      if (res.status != 200) {
        wx.showToast({
          title: res.message || '获取失败！',
          icon: 'none',
          mask: true
        });
        return;
      }
      this.item = res.result;
    }
  }
};
</script>
